package net.TCP;

import java.io.DataInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.ServerSocket;
import java.net.Socket;

public class Receiver {
    public static void main(String[] args) throws Exception {
        ServerSocket serverSocket = new ServerSocket(6666);
        Socket accept = serverSocket.accept();
        InputStream inputStream = accept.getInputStream();
        DataInputStream dis = new DataInputStream(inputStream);
        String s = dis.readUTF();
        System.out.println(s);
        System.out.println(accept.getRemoteSocketAddress());
        dis.close();
        serverSocket.close();
    }
}
